<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class StoreBargainUserHelp extends Model
{
    use HasFactory;

    /**
     * 默认倒序
     */
    protected $defaultSortCriteria = ['id,desc'];

    /**
     * 关联砍价商品模型
     */

    public function storeBargain()
    {
        return $this->belongsTo(StoreBargain::class, 'bargain_id', 'id');
    }

    /**
     * 关联用户模型
     */

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }
}
